<script setup lang="ts">
import { onMounted, ref } from "vue"
import  store1 from "../../store/index"
import {onBeforeRouteLeave} from "vue-router"
let store:any = store1()

onBeforeRouteLeave((to,from,next)=>{
    store.search_res=[]
    next()
})
// let myarr = toRaw(store.search_res)



// let myarr2 = JSON.parse(JSON.stringify(store.$state.search_res))

</script>
<template>
    <el-row>
        <template v-for="el in store.search_res" >
            <el-col class="card" style="background-color:white;" v-if="store.initial_tag==el.initial && store.disease_tag==el.class">
                <div class="title" style="background-color:white">{{el.name}}</div>
                <div class="info" style="background-color:white">{{el.content}}</div>
                <div v-if="el.check=='审核专家'">
                    <div class="expert" style="background-color:white">
                        <div class="expert_tag">
                            {{el.check}}
                        </div>
                        <img :src=el.check_profile alt="" class="expert-avatar" />
                        <p class="expert-content" style="background-color:white">
                            <span>{{el.check_name}}</span>
                            &nbsp;
                            <span>{{el.check_class}}</span>
                            &nbsp;
                            <span>{{el.check_job}}</span>
                        </p>
                    </div>
                </div>
            </el-col>
        </template>
    </el-row>

</template>
<style scoped lang="scss">
.card {
    border-radius: 4px;
    background-color: #fff;
    margin-bottom: 20px;
    padding: 28px 30px;
    display: block;
    border: 1px solid #fff;

    .title {
        font-size: 20px;
        font-weight: 500;
        line-height: 24px;
        color: #252a33;
    }

    .info {
        font-size: 16px;
        line-height: 20px;
        color: #444c57;
        display: -webkit-box;
        word-break: break-all;
        overflow: hidden;
        -webkit-line-clamp: 1;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        white-space: normal !important;
        margin-top: 20px;
    }

    div .expert {
        display: flex;
        justify-items: flex-start;
        align-items: center;
        margin-top: 16px;

        .expert_tag {
            width: 56px;
            height: 24px;
            border-radius: 4px;
            background-color: #f2f3f5;
            font-size: 12px;
            line-height: 16px;
            color: #818993;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .expert-avatar {
            width: 20px;
            height: 20px;
            border: 1px solid rgba(0, 0, 0, .05);
            margin-left: 16px
        }

        .expert-content {
            font-size: 14px;
            line-height: 18px;
            color: #99a0aa;
            margin-left: 8px;

            span {
                font-size: 14px;
                line-height: 18px;
                color: #99a0aa;
                background-color: white
            }
        }
    }
}
</style>